home *** CD-ROM | disk | FTP | other *** search
/ SGI Developer Toolbox 6.1 / SGI Developer Toolbox 6.1 - Disc 4.iso / src / exampleCode / irix / tools / README < prev    next >
Encoding:
Text File  |  1994-08-02  |  12.0 KB  |  310 lines

  1.  
  2.              ~4Dgifts/toolbox/src/exampleCode/irix/tools README
  3.  
  4.  
  5.     contains the beginnings of an irix tools subtree of programs 
  6.     relevant to unix/system programming.
  7.  
  8.  
  9.  
  10.     Lastrev      collects information about the revisions and symbols 
  11.                  defined in RCS files and then prints this information.
  12.  
  13.     Synopsis:
  14.         Lastrev [-bl] [[-a] -s <symbol>] { <file-list> | <directory> }
  15.                  -a    Print all files even if symbol not defined
  16.                  -b    Print base revision number for each symbol
  17.                  -t    Do not print title lines
  18.  
  19.  
  20.  
  21.                         ------------------------------
  22.  
  23.  
  24.     chktime      Compares two files modification times and returns -1, 0
  25.                  or +1 depending on whether the first file was modified
  26.                  before, at the same time or after the second file.
  27.     Synopsis:
  28.          chktime [-d] [-r] <source-file> <object-file | executable-file>
  29.  
  30.     Description:
  31.          The purpose of this routine is to determine if a particular
  32.          source file needs to be recompiled.  For developer's not using
  33.          the features of make to determine this need, this routine
  34.          had to be written.  chktime can also be used to determine if a 
  35.      file is newer than some other file.  For example, if you want to 
  36.      copy all the new files to a tape, you can use chktime to compare 
  37.      files to some "reference file" and only tar those that are newer 
  38.      (or older).
  39.    
  40.          The functions performed by chktime are as follows:
  41.          1.  If -r option given, skip to step 3.
  42.          2.  If the source file exists in the current directory:
  43.              a.  Set MODTIM to the last modified time of the file.
  44.              b.  Skip to step 5.
  45.          3.  If the source file does not exist in ./RCS as an RCS
  46.              file, exit with an error message.
  47.          4.  Set MODTIM to the last modified time of the latest
  48.              revision in the RCS file.
  49.          5.  If MODTIM is less than or equal to the modification
  50.              time of the object file, return with a -1 or 0.
  51.          6.  Return with status of 1.
  52.    
  53.          The option -d will enable debug output.
  54.  
  55.  
  56.  
  57.                         ------------------------------
  58.  
  59.  
  60.    getopt       Enhanced version of the getopt command provided with Unix.
  61.  
  62.    Synopsis:
  63.         getopt [-o <name>] <optstring> <options>
  64.   
  65.    Description:
  66.         Identical to the system 'getopt' command except that it has the
  67.         additional functions:
  68.         1.      If the -o option is provided, checks a file called
  69.                 .getopt for a line that begins with <name>.  It then
  70.                 uses the options provided on this line as defaults.
  71.         2.      Normally, the option string contains letters and,
  72.                 optionally, colons to indicate that an option must
  73.                 be followed by an argument.  In addition, we allow
  74.                 a '=' to indicate that an option might be followed
  75.                 immediately by an argument (with no white space),
  76.                 a '+' to indicate that an option might be followed
  77.                 by an argument (with white space).
  78.  
  79.  
  80.  
  81.                         ------------------------------
  82.  
  83.  
  84.    gettime    Gets the last modification time of the file and writes it 
  85.         to stdout.
  86.    Synopsis:
  87.       gettime [-d] [-i] [-c | -m | -a] [[+<format>] <file>] [[+<format>] \
  88.           <file>] ...
  89.    Description:
  90.       This routine writes to stdout the file time for the file(s)
  91.       specified.  If -c is specified, the creation time is written;
  92.       -m for modification time and -a for access time.  Modification
  93.       time is assumed.  If format is specified, it will display the
  94.       time for all the following files (until another format is
  95.       specified) in the format given.  Otherwise, the date and time
  96.       will be printed according to the default of ctime(3C).  Format
  97.       is defined the same way as for the date(1) command except the
  98.     '%' sign is not required.  For example, to get the julian date
  99.     for a file, the command 'gettime "+j" <file>' will return this
  100.     date.
  101.   
  102.       The -d option enables debug printout.
  103.   
  104.     The -i option overrides any format(s) provided and prints the
  105.     date in integer format.  This is useful when comparing the
  106.     time of two files in shell scripts.
  107.  
  108.  
  109.  
  110.                         ------------------------------
  111.  
  112.  
  113.    gpasswd    identical to passwd except it sets the password for a
  114.         group in the /etc/group file.
  115.  
  116.    Format of call:
  117.       gpasswd [group]
  118.    Where:
  119.       group    Is an optional group name to change.  The user must be
  120.           in the list of users allowed to be in the group to
  121.           change the group password.  If 'group' is not specified,
  122.           the user's current group will be assumed.
  123.    Features:
  124.       - If user is root, does not ask for current password.
  125.       - If no password exists yet, does not ask for current password.
  126.       - If YP entry, keeps it a YP entry.
  127.    Discussion:
  128.     This is just some discussion on how the group password works and
  129.     how groups are used in UNIX.
  130.  
  131.     If the user needs the privileges of a group other than their
  132.     default group, the user can use the 'newgrp' command.  If the user
  133.     is root or in the list in /etc/group for the new group, newgrp
  134.     starts a new shell (using whatever shell is the default shell)
  135.     having the new group as its group ID.  Note: To return to the old
  136.     group, all one has to do is exit the current shell.
  137.   
  138.     If the user is not in the list of accepted users for a group,
  139.     newgrp will ask for a password (if one exists for that group in
  140.     /etc/group).  If no password exists and the user is not in the
  141.     list, newgrp will not allow the change.  If a password is present
  142.     and the user enters it correctly, newgrp will start a new shell
  143.     having the new group as its group ID.
  144.  
  145.     This mechanism provides a means by which to set the password for a
  146.     group.  UNIX provides no other mechanism for doing this.  This
  147.     feature also provides a form of control over who has certain group
  148.     privileges.
  149.  
  150.  
  151.  
  152.                         ------------------------------
  153.  
  154.  
  155.     isIn       returns true/false indication if the first parameter is equal 
  156.                to any of the other parameters on the command line.  Useful 
  157.                in shell scripts to find out if a directory is already in the
  158.                path or a host is in a list of hosts, etc.
  159.  
  160.  
  161.  
  162.                         ------------------------------
  163.  
  164.  
  165.     listWMres  lists all the resources known to the window manager.  This 
  166.                tells you what resources have been set in the .Xresources and 
  167.                any merged resources added afterwards with xrdb.
  168.  
  169.  
  170.  
  171.                         ------------------------------
  172.  
  173.  
  174.     printf     does the same thing as the printf command in C but as a 
  175.                command in a shell script.  Better than the one provided with
  176.                IRIX 5.x because it can handle all the standard C types 
  177.                (integers, floating point, etc.).
  178.  
  179.  
  180.  
  181.                         ------------------------------
  182.  
  183.  
  184.     rcstime    returns the time of the last checked in revision of an RCS 
  185.                file (or the time of the specified revision).  If the -i 
  186.                option is used (to return the time in decimal), the number
  187.                can be used to compare in shell scripts.
  188.  
  189.     Synopsis:
  190.          rcstime [+<format>] [-i] [-R] [-r<rev>] file [[-r<rev>] files...]
  191.   
  192.     Description:
  193.          This program writes to stdout the time of the last update found
  194.          in the RCS file.  The program uses the same search sequence for
  195.          the RCS file as the standard RCS programs (co, ci, rcs).  For
  196.          information on how it finds the RCS file, see below under File
  197.          Search Method.
  198.    
  199.          The -r<rev> option identifies which revision from the RCS file
  200.          is to be used in computing the modification time.  If just -r
  201.          is given (with no <rev>), the latest known revision is selected.
  202.    
  203.          The +<format> option provides a format that is to be used in
  204.          writing the time.  This format is identical to the date(1)
  205.          command.
  206.    
  207.          The -i option overrides any format provided and prints the date
  208.          in integer format.
  209.    
  210.          The -R option specifies that the actual revision number that was
  211.          found should also be printed.
  212.    
  213.     File Search Method:
  214.          If the file name ends in ",v", it is take to be an RCS file.
  215.          All other files are assumed to be working files and the names
  216.          are converted be RCS files.  If no path is provided, the RCS
  217.          file is looked for in the directory ./RCS and then in the
  218.          current directory.  If a path is provided, the RCS file is
  219.          looked for only in the directory provided.
  220.  
  221.  
  222.  
  223.                         ------------------------------
  224.  
  225.  
  226.     strlen     does the same thing as the strlen command in C by returning 
  227.                the length of the string provided on the command line.
  228.  
  229.            strlen allows a shell program to count the number of
  230.            characters in a string.  Assuming it was reading a file or 
  231.            input of some sort, it can determine how many characters are 
  232.            in a word or line.  There is no way to do this from within 
  233.            a shell script.
  234.  
  235.  
  236.  
  237.                         ------------------------------
  238.  
  239.  
  240.     unique     returns all the parameters passed on the command line 
  241.                removing any duplicates.  Thus, if you have a line like 'set
  242.                path = ( $path ... )' in your .cshrc or .login files and you
  243.                execute these files more than once (which some people do), 
  244.                the unique command will remove path elements that get 
  245.                duplicated.
  246.  
  247.  
  248.  
  249.                         ------------------------------
  250.  
  251.  
  252.     vacupd     reads and modifies data in the vacation database files.
  253.  
  254.     Format of call:
  255.     vacupd
  256.  
  257.     Discussion:
  258.     This program allows the user to print, remove and add names to
  259.     the vacation database.  This database is generated by the
  260.     'vacation(1)' command and is used to determine which mail
  261.     users and aliases to send vacation messages to.
  262.  
  263.     When a user is going on vacation, they frequently want people
  264.     who send them mail to be aware that they won't get a reply
  265.     until the user returns from vacation.  To do this, the user
  266.     runs the vacation(1) program and creates a .vacation.msg file
  267.     with the text they want sent to other people to inform them
  268.     that the user is on vacation.
  269.  
  270.     Many times, the user is on a large distribution list and, when
  271.     the vacation program replies with the vacation message, all
  272.     the people on the distribution list gets the vacation message.
  273.     This is usually undesirable but, until now, there was no way
  274.     of stopping it from happening.
  275.  
  276.     With this program, before the user actually goes on vacation
  277.     and before they forward their mail to be intercepted by the
  278.     vacation program but after initializing the vacation database,
  279.     the user can view what default values are set up in the
  280.     database and they can add specific aliases or users to the
  281.     database so they won't get the vacation message.
  282.  
  283.     The program should be run in the user's home directory (where
  284.     the .vacation* files reside).  The program expects these files
  285.     to exist in the current directory, thus allowing the user to
  286.     copy these files to another directory and modify them or look
  287.     at the copies without affecting the ones actually used.
  288.  
  289.     Running the program brings up a little menu of functions that
  290.     can be performed.
  291.  
  292.     When initializing the database, one of the options is the
  293.     interval between sending messages to users.  Thus, after the
  294.     first message to "Jane Doe", Jane won't get another vacation
  295.     message for <interval> days, no matter how many pieces of mail
  296.     she sends to the user.
  297.  
  298.     By default, when a user name (or alias) is added, this
  299.     interval is used to initialize the user's entry.
  300.  
  301.     When adding an 'ignored' user, a big interval is used to
  302.     initialize the entry, which should be a number of years.
  303.  
  304.     Removing a user will make it so they receive a vacation
  305.     message the first time they send a message.
  306.  
  307.     Print will print everything in the database so far.  This
  308.     command is useful after the owner returns from vacation to
  309.     find out who has sent mail while they were gone.
  310.